WeldManagedReferenceFactory{
  this.ejbName=ejbName;
}
getReference{
  final CreationalContext<?> ctx;
    ctx=beanManager.createCreationalContext(null);
 else {
    ctx=beanManager.createCreationalContext(bean);
  final Object instance=injectionTarget.produce(ctx);
  return new WeldManagedReference(ctx,instance,injectionTarget,interceptorInjections);
}
injectExistingReference{
  final CreationalContext<?> ctx;
  if (bean == null) {
    ctx=beanManager.createCreationalContext(null);
    ctx=beanManager.createCreationalContext(bean);
  final Object instance=existing.getInstance();
  injectionTarget.inject(instance,ctx);
    @Override public void release(){
        existing.release();
        ctx.release();
    @Override public Object getInstance(){
      return instance;
}
release{
  try {
    existing.release();
  finally {
    ctx.release();
}
getInstance{ }
start{
  final ClassLoader cl=SecurityActions.getContextClassLoader();
  try {
    SecurityActions.setContextClassLoader(classLoader);
    beanManager=(BeanManagerImpl)weldContainer.getValue().getBeanManager(beanDeploymentArchiveId);
    for (    final Class<?> interceptor : interceptorClasses) {
      interceptorInjections.put(interceptor,WeldEEInjection.createWeldEEInjection(interceptor,null,beanManager));
    if (ejbName != null) {
      EjbDescriptor<Object> descriptor=beanManager.getEjbDescriptor(ejbName);
      if (descriptor != null) {
        bean=beanManager.getBean(descriptor);
    injectionTarget=WeldEEInjection.createWeldEEInjection(componentClass,bean,beanManager);
  finally {
    SecurityActions.setContextClassLoader(cl);
}
stop{
  injectionTarget=null;
}
getValue{ }
getWeldContainer{ }
